//package com.redis.topic;
//
//import org.redisson.api.RTopic;
//import org.redisson.api.RedissonClient;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import javax.annotation.Resource;
//
//@Configuration
//public class TopicListener {
//
//    public TopicListener() {
//        System.out.println("TopicListener启动");
//    }
//
//    @Resource
//    private RedissonClient redissonClient;
//
//    @Bean
//    public void Listener(){
//        RTopic<String> topic = redissonClient.getTopic("anyTopic");
//        topic.addListener((channel, msg) -> System.out.println(msg));
//        System.out.println("anyTopic被监听");
//    }
//
//}
